import request from '@/utils/request.js'

// 任务列表
export const getTaskList = () => {
  return request({
    url: '/tasks/showAllTasks',
    method: 'GET',
  })
}

// 任务详情
export const getTaskDetail = (data) => {
  return request({
    url: `/tasks/specificTask`,
    method: 'POST',
    data
  })
}

// 任务创建
export const createTask = (data) => {
  return request({
    url: '/tasks/create',
    method: 'POST',
    data,
  })
}



// 摄像头列表
export const getCameraList = () => {
  return request({
    url: '/tasks/listAllCamera',
    method: 'GET',
  })
}


// 任务的实时信息
export const getTaskRealTimeInfo = (data) => {
  return request({
    url: `/tasks/showCurrentStates`,
    method: 'POST',
    data
  })
}
//暂停、开始或结束任务
export const handleProcessControl = (data) => {
  return request({
    url: `/tasks/handleProcessControl`,
    method: 'POST',
    data,
  })
}



// 重置节拍
export const resetBeat = (data) => {
  return request({
    url: `/tasks/resetBeat`,
    method: 'POST',
    data,
  })
}

// 强制放行
export const forcePass = (data) => {
  return request({
    url: `/tasks/forcedRelease`,
    method: 'POST',
    data,
  })
}


